package com.ray.life;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.util.Log;

public class StartActivity extends Activity {
    private final String TAG = "StartActivity";

    private final int DELAY_DURATION = 3 * 1000;

    public static void show(Activity activity, int requestCode) {
        Intent intent = new Intent(activity, StartActivity.class);
        activity.startActivityForResult(intent, requestCode);
    }
    
    private final Handler mHandler = new Handler() {
        @Override
        public void handleMessage(final Message msg) {
            StartActivity.this.finish();
        }
    };

    @Override
    public void onCreate(final Bundle icicle) {
        super.onCreate(icicle);
        Log.v(TAG, " onCreate");

        this.setContentView(R.layout.start_activity);

        new Thread() {

            @Override
            public void run() {
                mHandler.sendMessageDelayed(mHandler.obtainMessage(), DELAY_DURATION);
            };
        }.start();
    }
}
